package com.winchain.chainbill.basic.cus.service.impl;

import com.shell.bee.base.utils.StringUtil;
import com.shell.bee.persistence.service.impl.PersistentServiceImpl;
import com.winchain.chainbill.basic.cus.dao.CusGrpDao;
import com.winchain.chainbill.basic.cus.po.CusGrp;
import com.winchain.chainbill.basic.cus.po.CusRec;
import com.winchain.chainbill.basic.cus.service.CusGrpService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("cusGrpService")
public class CusGrpServiceImpl extends PersistentServiceImpl<CusGrp> implements CusGrpService {
	@Autowired
	CusGrpDao cusGrpDao;

	public List<CusRec> findGroupEnts(String grpId, String tagCode) {
		String[] tagCodes = null;
		if (StringUtil.notEmpty(tagCode)) {
			tagCodes = tagCode.split(",");
		}
		return this.cusGrpDao.findGroupEnts(grpId, tagCodes);
	}

	public List<CusGrp> selectGroupsByValCom() {
		return this.cusGrpDao.selectGroupsByValCom();
	}
}
